Excel to VISIO - How to refer both the partitions of "2-part metric" under "TQM Diagram Shapes"

Hi All,<o:p></o:p>

I am trying to update VISIO using an Excel sheet through Excel vba automation.<o:p></o:p>

Please help as I am trying to use a shape "2-part metric" under "TQM Diagram Shapes" in VISIO.<o:p></o:p>

"2-part metric" under "TQM Diagram Shapes" in VISIO has 2 portions to it one is small above and the other one is small below.<o:p></o:p>

However, I am not able to figure out how to paste the text in the above (comparatively small portion) pro grammatically, everything is going in the big portion.<o:p></o:p>

Any help in this regards will be appreciated a lot.<o:p></o:p>

Regards<o:p></o:p>

Abhimanyu<o:p></o:p>


July 22nd, 2015 11:51am

0. Paste this code in your module

Sub vv()
Dim ea As Object 'Excel.Application
Set ea = GetObject(, "Excel.Application")
Dim ew As Object 'Excel.Workbook
Set ew = ea.activeworkbook
Dim sh As Visio.Shape ' parent shape
Dim ssh As Visio.Shape
Set sh = ActiveWindow.Selection(1) ' set selected shape as target shape
For i = 1 To sh.Shapes.Count
Set ssh = sh.Shapes(i) ' iterate sub-shapes
ssh.Text = ew.sheets(1).Cells(1, i) ' set text from cells in first row
Next
End Sub
1. Open some workbook

2. Select one shape in window

3. Just run this code

Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2015 4:04pm

0. Paste this code in your module

Sub vv()
Dim ea As Object 'Excel.Application
Set ea = GetObject(, "Excel.Application")
Dim ew As Object 'Excel.Workbook
Set ew = ea.activeworkbook
Dim sh As Visio.Shape ' parent shape
Dim ssh As Visio.Shape
Set sh = ActiveWindow.Selection(1) ' set selected shape as target shape
For i = 1 To sh.Shapes.Count
Set ssh = sh.Shapes(i) ' iterate sub-shapes
ssh.Text = ew.sheets(1).Cells(1, i) ' set text from cells in first row
Next
End Sub
1. Open some workbook

2. Select one shape in window

3. Just run this code

  • Marked as answer by abhisrma 18 hours 45 minutes ago
July 22nd, 2015 8:02pm

0. Paste this code in your module

Sub vv()
Dim ea As Object 'Excel.Application
Set ea = GetObject(, "Excel.Application")
Dim ew As Object 'Excel.Workbook
Set ew = ea.activeworkbook
Dim sh As Visio.Shape ' parent shape
Dim ssh As Visio.Shape
Set sh = ActiveWindow.Selection(1) ' set selected shape as target shape
For i = 1 To sh.Shapes.Count
Set ssh = sh.Shapes(i) ' iterate sub-shapes
ssh.Text = ew.sheets(1).Cells(1, i) ' set text from cells in first row
Next
End Sub
1. Open some workbook

2. Select one shape in window

3. Just run this code

  • Marked as answer by abhisrma Thursday, July 23, 2015 12:47 PM
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2015 8:02pm

0. Paste this code in your module

Sub vv()
Dim ea As Object 'Excel.Application
Set ea = GetObject(, "Excel.Application")
Dim ew As Object 'Excel.Workbook
Set ew = ea.activeworkbook
Dim sh As Visio.Shape ' parent shape
Dim ssh As Visio.Shape
Set sh = ActiveWindow.Selection(1) ' set selected shape as target shape
For i = 1 To sh.Shapes.Count
Set ssh = sh.Shapes(i) ' iterate sub-shapes
ssh.Text = ew.sheets(1).Cells(1, i) ' set text from cells in first row
Next
End Sub
1. Open some workbook

2. Select one shape in window

3. Just run this code

  • Marked as answer by abhisrma Thursday, July 23, 2015 12:47 PM
July 22nd, 2015 8:02pm

0. Paste this code in your module

Sub vv()
Dim ea As Object 'Excel.Application
Set ea = GetObject(, "Excel.Application")
Dim ew As Object 'Excel.Workbook
Set ew = ea.activeworkbook
Dim sh As Visio.Shape ' parent shape
Dim ssh As Visio.Shape
Set sh = ActiveWindow.Selection(1) ' set selected shape as target shape
For i = 1 To sh.Shapes.Count
Set ssh = sh.Shapes(i) ' iterate sub-shapes
ssh.Text = ew.sheets(1).Cells(1, i) ' set text from cells in first row
Next
End Sub
1. Open some workbook

2. Select one shape in window

3. Just run this code

  • Marked as answer by abhisrma Thursday, July 23, 2015 12:47 PM
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2015 8:02pm

0. Paste this code in your module

Sub vv()
Dim ea As Object 'Excel.Application
Set ea = GetObject(, "Excel.Application")
Dim ew As Object 'Excel.Workbook
Set ew = ea.activeworkbook
Dim sh As Visio.Shape ' parent shape
Dim ssh As Visio.Shape
Set sh = ActiveWindow.Selection(1) ' set selected shape as target shape
For i = 1 To sh.Shapes.Count
Set ssh = sh.Shapes(i) ' iterate sub-shapes
ssh.Text = ew.sheets(1).Cells(1, i) ' set text from cells in first row
Next
End Sub
1. Open some workbook

2. Select one shape in window

3. Just run this code

  • Marked as answer by abhisrma Thursday, July 23, 2015 12:47 PM
July 22nd, 2015 8:02pm

0. Paste this code in your module

Sub vv()
Dim ea As Object 'Excel.Application
Set ea = GetObject(, "Excel.Application")
Dim ew As Object 'Excel.Workbook
Set ew = ea.activeworkbook
Dim sh As Visio.Shape ' parent shape
Dim ssh As Visio.Shape
Set sh = ActiveWindow.Selection(1) ' set selected shape as target shape
For i = 1 To sh.Shapes.Count
Set ssh = sh.Shapes(i) ' iterate sub-shapes
ssh.Text = ew.sheets(1).Cells(1, i) ' set text from cells in first row
Next
End Sub
1. Open some workbook

2. Select one shape in window

3. Just run this code

  • Marked as answer by abhisrma Thursday, July 23, 2015 12:47 PM
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2015 8:02pm

0. Paste this code in your module

Sub vv()
Dim ea As Object 'Excel.Application
Set ea = GetObject(, "Excel.Application")
Dim ew As Object 'Excel.Workbook
Set ew = ea.activeworkbook
Dim sh As Visio.Shape ' parent shape
Dim ssh As Visio.Shape
Set sh = ActiveWindow.Selection(1) ' set selected shape as target shape
For i = 1 To sh.Shapes.Count
Set ssh = sh.Shapes(i) ' iterate sub-shapes
ssh.Text = ew.sheets(1).Cells(1, i) ' set text from cells in first row
Next
End Sub
1. Open some workbook

2. Select one shape in window

3. Just run this code

  • Marked as answer by abhisrma Thursday, July 23, 2015 12:47 PM
July 22nd, 2015 8:02pm

0. Paste this code in your module

Sub vv()
Dim ea As Object 'Excel.Application
Set ea = GetObject(, "Excel.Application")
Dim ew As Object 'Excel.Workbook
Set ew = ea.activeworkbook
Dim sh As Visio.Shape ' parent shape
Dim ssh As Visio.Shape
Set sh = ActiveWindow.Selection(1) ' set selected shape as target shape
For i = 1 To sh.Shapes.Count
Set ssh = sh.Shapes(i) ' iterate sub-shapes
ssh.Text = ew.sheets(1).Cells(1, i) ' set text from cells in first row
Next
End Sub
1. Open some workbook

2. Select one shape in window

3. Just run this code

  • Marked as answer by abhisrma Thursday, July 23, 2015 12:47 PM
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2015 8:02pm

0. Paste this code in your module

Sub vv()
Dim ea As Object 'Excel.Application
Set ea = GetObject(, "Excel.Application")
Dim ew As Object 'Excel.Workbook
Set ew = ea.activeworkbook
Dim sh As Visio.Shape ' parent shape
Dim ssh As Visio.Shape
Set sh = ActiveWindow.Selection(1) ' set selected shape as target shape
For i = 1 To sh.Shapes.Count
Set ssh = sh.Shapes(i) ' iterate sub-shapes
ssh.Text = ew.sheets(1).Cells(1, i) ' set text from cells in first row
Next
End Sub
1. Open some workbook

2. Select one shape in window

3. Just run this code

  • Marked as answer by abhisrma Thursday, July 23, 2015 12:47 PM
July 22nd, 2015 8:02pm

Dear Sir, 

You are a genious...... :) 

Really appreciate you helping me with it.

Thanks a ton.

Abhimanyu

Free Windows Admin Tool Kit Click here and download it now
July 23rd, 2015 8:47am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics